package com.hbnu.sync.service.impl;

import com.hbnu.sync.domain.entity.SyncUser;
import com.hbnu.sync.mapper.SyncUserMapper;
import com.hbnu.sync.service.ISyncUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jxl
 * @since 2025-08-23
 */
@Service
public class SyncUserServiceImpl extends ServiceImpl<SyncUserMapper, SyncUser> implements ISyncUserService {

    /**
     * 同步所有用户到主服务数据库
     *
     * @return
     */
    @Override
    public List<SyncUser> MoveAllUser() {
        // 查询所有用户数据，排除deptCode字段
        List<SyncUser> syncUserList = query().select(
            "uid", "account", "roles", "password", "name", "teacherID", 
            "dept", "origin", "gender", "numID", "birthday", "finalEducation", 
            "finalDegree", "titleLevel", "title", "outlook", "jobCategory", 
            "appoindate", "duties", "disciplineCategories", "firstDiscipline", 
            "secondaryDiscipline", "tertiaryDiscipline", "direction", "officePhone", 
            "fax", "phone", "QQ", "Email", "address", "zipcode", "introduction", 
            "honor", "image", "usedname", "nowState", "techTitle", "techDate", 
            "nationality", "homePhone", "postdoctor"
        ).list();
        return syncUserList;
    }
}
